 function showrecentposts(json) {
             
	j = (showRandomImg) ? Math.floor((imgr.length+1)*Math.random()) : 0;
	img  = new Array();
	
	var strslider='';
	var strthumbs = '<ul>';
	var title_len = 50;
	var content_len = 100;
	
  	for (var i = 0; i < numposts; i++) {
    	var entry = json.feed.entry[i];
    	var posttitle = entry.title.$t;
		var pcm;
    	var posturl;
    	if (i == json.feed.entry.length) break;
    	for (var k = 0; k < entry.link.length; k++) {
      		if (entry.link[k].rel == 'alternate') {
        		posturl = entry.link[k].href;
        		break;
      		}
    	}
		
		for (var k = 0; k < entry.link.length; k++) {
      		if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {
        		pcm = entry.link[k].title.split(" ")[0];
        		break;
      		}
    	}
		
    	if ("content" in entry) {
      		var postcontent = entry.content.$t;}
    	else
    	if ("summary" in entry) {
      		var postcontent = entry.summary.$t;}
    	else var postcontent = "";
    	
    	postdate = entry.published.$t;
	
	if(j>imgr.length-1) j=0;
	img[i] = imgr[j];
	
	s = postcontent	; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);

	if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) img[i] = d.replace("s400","s610");
	
	strthumbs += '<li class="ui-tabs-nav-item" id="nav-fragment-'+i+'"><a href="#fragment-'+i+'"><img alt="'+posttitle+'" height="60" src="'+img[i]+'" width="80"/><span>'+removeHtmlTag(posttitle,title_len)+'</span></a></li>';
	if(i== (4))
		strthumbs += '</ul>';
	strslider += '<div class="ui-tabs-panel ui-tabs-hide" id="fragment-'+i+'"><img alt="'+posttitle+'" height="290" src="'+img[i]+'" width="430"/><div class="info"><h3><a href="'+posturl+'">'+removeHtmlTag(posttitle,title_len)+'</a></h3><p>'+removeHtmlTag(postcontent,content_len)+'<a href="'+posturl+'">Xem thêm</a></p></div></div>';	
	
	j++;
}
var featured = document.getElementById("featured");
featured.innerHTML =  strthumbs + strslider;

}
document.write("<script src=\""+home_page+"feeds/posts/default/-/"+label+"?max-results="+numposts+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>");